package expriment3_bag;
public class two {
    public static void main(String[] args) {
        System.out.println("Fibonacci数列前30项项值如下：");
        //定义一维数组
        int [] a = new int[30];
        //初始化
        a[0] = 1;
        a[1] = 1;
        //向后计算
        for (int i=2;i<a.length;i++){
            a[i] = a[i-1]+a[i-2];
        }
        //输出
        for (int i=1;i<=a.length;i++){
            System.out.printf("%-8d",a[i-1]);
            if(i%6==0){
                System.out.println();
            }
        }
    }
}
